<template>
  <div class="about">
  <h1>person{{person}}</h1>
  <button @click="changeperson">改变count</button>
  
  </div>
</template>

<script lang="ts">
 import {defineComponent} from "vue"
export default defineComponent({
  name :"About",
 
});


</script>
<script lang="ts" setup>
import {ref, watch}from 'vue';

let person = ref({
    name: "老王",
    age: 18,
    score: {
    math: 100,
    en: 90,
  },
})
const changeperson=()=>{
 person.value.score.math = 101;
};
watch(
  person.value,(nweValue,oldValue)=>{
console.log("count的监听", nweValue, oldValue);
  },{
    immediate:true
  }
)







</script>